var t = function(t) {
    return t && t.__esModule ? t : {
      default: t
    };
  }(require("../../../../utils/toot.js")),
  e = getApp(),
  a = 0;

Page({
  data: {
    prenumber: 10,
    url: "patient/mycommunity/list/",
    curHdIndex: 1,
    communityListOne: [],
    pageOne: 0,
    moreBooOne: !0,
    loadingBoo: !0,
    oneBoo: !1,
    mask: !0,
    communityListOne: []
  },
  addCommunity: function() {
    wx.navigateTo({
      url: "/hyb_yl/userLife/pages/addDynamic/addDynamic"
    });
  },
  bindscroll: function(t) {
    t.detail.scrollTop > this.data.windowHeight ? this.setData({
      topFlag: !0
    }) : this.setData({
      topFlag: !1
    });
  },
  toTop: function(t) {
    this.setData({
      topFlag: !1,
      scrollTop: 0
    });
  },
  moreState: function() {
    var e = this,
      a = {},
      n = e.data.prenumber + "/" + e.data.token;
    t.default.getCommunityList(e, a, n);
  },
  toLike: function(e) {
    var a = this,
      n = e.currentTarget.dataset.index,
      i = e.currentTarget.dataset.status;
    1 != i ? a.data.currindex != n || 1 == i ? (a.setData({
      currindex: n
    }), t.default.toLike(a, e, 1)) : wx.showToast({
      title: "【点赞】是严肃的，不可以反悔哦！",
      icon: "none",
      duration: 2e3
    }) : wx.showToast({
      title: "【点赞】是严肃的，不可以反悔哦！",
      icon: "none",
      duration: 1500
    });
  },
  previewImageOne: function(t) {
    a = 0;
    var n = [],
      i = this.data.communityListOne,
      o = t.target.dataset.imgindex,
      r = t.currentTarget.dataset.tid;
    i && i.forEach(function(t) {
      if (t.tid == r) return n = t.estimateTcontentImgBig, !1;
    }), e.previewImage(t, n, o);
  },
  previewImageTwo: function(t) {
    a = 0;
    var n = [],
      i = this.data.communityListOne,
      o = t.target.dataset.imgindex,
      r = t.currentTarget.dataset.tid;
    i && i.forEach(function(t) {
      if (t.tid == r) return n = t.patientBbsReplyVO.estimatePicBigUrl, !1;
    }), e.previewImage(t, n, o);
  },
  onLoad: function(t) {
    var bgc = wx.getStorageSync('color')
    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: bgc,
    })
  },
  onReady: function() {
    this.getAllmyshare()
  },
  onShow: function() {

  },
  onHide: function() {
    1 == a && this.setData({
      communityListOne: []
    }), a = 1;
  },
  getAllmyshare: function() {
    var that = this
    e.util.request({
      'url': 'entry/wxapp/share.myshare',
      data: {
        openid:wx.getStorageSync('openid'),
      },
      success: function(res) {
        console.log(res)
        that.setData({
          communityListOne:res.data
        })
      }
    })
  }
});